import { useState } from "react"
import { useNavigate } from "react-router"
import { Space } from "antd"
import styles from '@/index.module.less'

export default function Welcome() {
  const [nickName, setNickName] = useState("")
  const navigate = useNavigate()
  return (
    <div className={styles.container}>
      <Space>
        <span>Welcome</span>
        <input type="text" onChange={(e) => setNickName(e.target.value)} value={nickName} />
        <button onClick={() => navigate(`/main?nickName=${nickName}`)}>进入游戏</button>
      </Space>
    </div>


  )
}
